<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<script>
    window.onload = function () {
        function Person() {
            Person.prototype.name = "whmk";
            Person.prototype.age = "22";
            Person.prototype.sayName = function () {
                alert(this.name);
            }
        };
        Person();
        var keys = Object.keys(Person.prototype);
        console.log(keys);//['name',"age","sayName"]
        let a=keys.some(item=>{return Person.prototype[item]==='22'});
        console.log(a);//true

        var p1 = new Person();
        p1.name = "Rob";
        p1.age = "20";
        var p1Keys = Object.keys(p1); 
        console.log(p1Keys);//['name',"age"] 
        p1.sayName();//Rob
    }
</script>

<body>

</body>

</html>